Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] [Security Solution][Case] Fix unhandled promise when updating alert status (#90605) #90647

Merged
merged 2 commits into from
Feb 8, 2021

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Feb 8, 2021

Backports the following commits to 7.x:

@cnasikas
Copy link
Member Author

cnasikas commented Feb 8, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / Chrome X-Pack UI Functional Tests.x-pack/test/functional/apps/index_management/feature_controls/index_management_security·ts.Index Management app feature controls security global dashboard all with index_management_user should render the "Data" section with index management

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]       │
[00:07:56]         └-: Index Management app
[00:07:56]           └-> "before all" hook in "Index Management app"
[00:07:56]           └-: feature controls
[00:07:56]             └-> "before all" hook in "feature controls"
[00:07:56]             └-: security
[00:07:56]               └-> "before all" hook in "security"
[00:07:56]               └-> "before all" hook in "security"
[00:07:56]                 │ info [empty_kibana] Loading "mappings.json"
[00:07:56]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_1/UDhU_l5ISpyYhLEvaQ-pOQ] deleting index
[00:07:56]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_2/X1wvrZg3QoOZEq-kcBurTA] deleting index
[00:07:56]                 │ info [empty_kibana] Deleted existing index ".kibana_2"
[00:07:56]                 │ info [empty_kibana] Deleted existing index ".kibana_1"
[00:07:56]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana] creating index, cause [api], templates [], shards [1]/[1]
[00:07:56]                 │ info [empty_kibana] Created index ".kibana"
[00:07:56]                 │ debg [empty_kibana] ".kibana" settings {"index":{"number_of_replicas":"1","number_of_shards":"1"}}
[00:07:56]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana/W_0iy9uPRRKqrw09SWtWHQ] update_mapping [_doc]
[00:07:56]                 │ debg Migrating saved objects
[00:07:56]                 │ proc [kibana]   log   [20:14:57.565] [info][savedobjects-service] Creating index .kibana_2.
[00:07:56]                 │ proc [kibana]   log   [20:14:57.570] [info][savedobjects-service] Creating index .kibana_task_manager_4.
[00:07:56]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_2] creating index, cause [api], templates [], shards [1]/[1]
[00:07:56]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] updating number_of_replicas to [0] for indices [.kibana_2]
[00:07:56]                 │ proc [kibana]   log   [20:14:57.593] [warning][environment] Detected an unhandled Promise rejection.
[00:07:56]                 │ proc [kibana] Error: Saved object [space/default] not found
[00:07:56]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_task_manager_4] creating index, cause [api], templates [], shards [1]/[1]
[00:07:56]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] updating number_of_replicas to [0] for indices [.kibana_task_manager_4]
[00:07:56]                 │ proc [kibana]   log   [20:14:57.681] [info][savedobjects-service] Reindexing .kibana to .kibana_1
[00:07:56]                 │ proc [kibana]   log   [20:14:57.700] [info][savedobjects-service] Migrating .kibana_task_manager_3 saved objects to .kibana_task_manager_4
[00:07:56]                 │ info [o.e.c.m.MetadataCreateIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_1] creating index, cause [api], templates [], shards [1]/[1]
[00:07:56]                 │ info [o.e.c.r.a.AllocationService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] updating number_of_replicas to [0] for indices [.kibana_1]
[00:07:56]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_task_manager_4/Hdoj9oUiQIyymHFhWn1ffQ] update_mapping [_doc]
[00:07:56]                 │ info [o.e.t.LoggingTaskListener] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] 16084 finished with response BulkByScrollResponse[took=1.5ms,timed_out=false,sliceId=null,updated=0,created=0,deleted=0,batches=0,versionConflicts=0,noops=0,retries=0,throttledUntil=0s,bulk_failures=[],search_failures=[]]
[00:07:56]                 │ proc [kibana]   log   [20:14:57.786] [info][savedobjects-service] Pointing alias .kibana_task_manager to .kibana_task_manager_4.
[00:07:56]                 │ proc [kibana]   log   [20:14:57.824] [info][savedobjects-service] Finished in 254ms.
[00:07:56]                 │ info [o.e.c.m.MetadataDeleteIndexService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana/W_0iy9uPRRKqrw09SWtWHQ] deleting index
[00:07:56]                 │ proc [kibana]   log   [20:14:58.067] [info][savedobjects-service] Migrating .kibana_1 saved objects to .kibana_2
[00:07:56]                 │ proc [kibana]   log   [20:14:58.071] [info][savedobjects-service] Pointing alias .kibana to .kibana_2.
[00:07:56]                 │ proc [kibana]   log   [20:14:58.100] [info][savedobjects-service] Finished in 537ms.
[00:07:56]                 │ debg [empty_kibana] Migrated Kibana index after loading Kibana data
[00:07:56]                 │ debg [empty_kibana] Ensured that default space exists in .kibana
[00:07:56]                 │ debg applying update to kibana config: {"accessibility:disableAnimations":true,"dateFormat:tz":"UTC"}
[00:07:56]                 │ info [o.e.c.m.MetadataMappingService] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] [.kibana_2/4Y9qrA2vQle4lnsmFcTMkg] update_mapping [_doc]
[00:07:58]                 │ debg navigating to home url: http://localhost:61191/app/home#/
[00:07:58]                 │ debg navigate to: http://localhost:61191/app/home#/
[00:07:58]                 │ debg browser[INFO] http://localhost:61191/app/home?_t=1612815299626#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:07:58]                 │
[00:07:58]                 │ debg browser[INFO] http://localhost:61191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:07:58]                 │ debg ... sleep(700) start
[00:07:59]                 │ debg ... sleep(700) end
[00:07:59]                 │ debg returned from get, calling refresh
[00:07:59]                 │ERROR browser[SEVERE] http://localhost:61191/38557/bundles/core/core.entry.js 12:158464 TypeError: Failed to fetch
[00:07:59]                 │          at fetch_Fetch.fetchResponse (http://localhost:61191/38557/bundles/core/core.entry.js:6:32451)
[00:07:59]                 │          at async interceptResponse (http://localhost:61191/38557/bundles/core/core.entry.js:6:28637)
[00:07:59]                 │          at async http://localhost:61191/38557/bundles/core/core.entry.js:6:31117
[00:07:59]                 │ debg browser[INFO] http://localhost:61191/app/home?_t=1612815299626#/ 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:07:59]                 │
[00:07:59]                 │ debg browser[INFO] http://localhost:61191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:00]                 │ debg currentUrl = http://localhost:61191/app/home#/
[00:08:00]                 │          appUrl = http://localhost:61191/app/home#/
[00:08:00]                 │ debg TestSubjects.find(kibanaChrome)
[00:08:00]                 │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:08:00]                 │ debg ... sleep(501) start
[00:08:00]                 │ debg ... sleep(501) end
[00:08:00]                 │ debg in navigateTo url = http://localhost:61191/app/home#/
[00:08:00]                 │ debg TestSubjects.exists(statusPageContainer)
[00:08:00]                 │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:08:03]                 │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:08:17]               └-: global dashboard all with index_management_user
[00:08:17]                 └-> "before all" hook for "should show the Stack Management nav link"
[00:08:17]                 └-> "before all" hook for "should show the Stack Management nav link"
[00:08:17]                   │ debg set roles = global_dashboard_all,index_management_user
[00:08:17]                   │ debg creating user test_user
[00:08:18]                   │ info [o.e.x.s.a.u.TransportPutUserAction] [kibana-ci-immutable-centos-tests-xxl-1612812109460212163] updated user [test_user]
[00:08:18]                   │ debg created user test_user
[00:08:18]                   │ debg TestSubjects.exists(kibanaChrome)
[00:08:18]                   │ debg Find.existsByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=2500
[00:08:18]                   │ debg browser[INFO] http://localhost:61191/app/management?_t=1612815312134 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:08:18]                   │
[00:08:18]                   │ debg browser[INFO] http://localhost:61191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:18]                   │ debg TestSubjects.find(kibanaChrome)
[00:08:18]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=100000
[00:08:19]                 └-> should show the Stack Management nav link
[00:08:19]                   └-> "before each" hook: global before each for "should show the Stack Management nav link"
[00:08:19]                   │ debg isGlobalLoadingIndicatorVisible
[00:08:19]                   │ debg TestSubjects.exists(globalLoadingIndicator)
[00:08:19]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:08:20]                   │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:08:21]                   │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:08:21]                   │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:08:21]                   │ debg TestSubjects.exists(collapsibleNav)
[00:08:21]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="collapsibleNav"]') with timeout=2500
[00:08:24]                   │ debg --- retry.tryForTime error: [data-test-subj="collapsibleNav"] is not displayed
[00:08:24]                   │ debg TestSubjects.click(toggleNavButton)
[00:08:24]                   │ debg Find.clickByCssSelector('[data-test-subj="toggleNavButton"]') with timeout=10000
[00:08:24]                   │ debg Find.findByCssSelector('[data-test-subj="toggleNavButton"]') with timeout=10000
[00:08:24]                   │ debg TestSubjects.find(collapsibleNav)
[00:08:24]                   │ debg Find.findByCssSelector('[data-test-subj="collapsibleNav"]') with timeout=10000
[00:08:24]                   │ debg Find.existsByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=2500
[00:08:24]                   │ debg Find.findByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:08:24]                   │ debg Find.clickByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:08:24]                   │ debg Find.findByCssSelector('[data-test-subj=collapsibleNav] > button') with timeout=10000
[00:08:24]                   └- ✓ pass  (5.4s) "Index Management app feature controls security global dashboard all with index_management_user should show the Stack Management nav link"
[00:08:24]                 └-> should render the "Data" section with index management
[00:08:24]                   └-> "before each" hook: global before each for "should render the "Data" section with index management"
[00:08:24]                   │ debg navigating to management url: http://localhost:61191/app/management
[00:08:24]                   │ debg navigate to: http://localhost:61191/app/management
[00:08:24]                   │ debg browser[INFO] http://localhost:61191/app/management?_t=1612815326081 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:08:24]                   │
[00:08:24]                   │ debg browser[INFO] http://localhost:61191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:24]                   │ debg ... sleep(700) start
[00:08:25]                   │ debg ... sleep(700) end
[00:08:25]                   │ debg returned from get, calling refresh
[00:08:26]                   │ debg browser[INFO] http://localhost:61191/app/management?_t=1612815326081 341 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:08:26]                   │
[00:08:26]                   │ debg browser[INFO] http://localhost:61191/bootstrap.js 42:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:08:26]                   │ debg currentUrl = http://localhost:61191/app/management
[00:08:26]                   │          appUrl = http://localhost:61191/app/management
[00:08:26]                   │ debg TestSubjects.find(kibanaChrome)
[00:08:26]                   │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:08:26]                   │ debg ... sleep(501) start
[00:08:27]                   │ debg ... sleep(501) end
[00:08:27]                   │ debg in navigateTo url = http://localhost:61191/app/management
[00:08:27]                   │ debg TestSubjects.exists(statusPageContainer)
[00:08:27]                   │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="statusPageContainer"]') with timeout=2500
[00:08:29]                   │ debg --- retry.tryForTime error: [data-test-subj="statusPageContainer"] is not displayed
[00:08:30]                   │ debg Find.allByCssSelector('.mgtSideBarNav > .euiSideNav__content > .euiSideNavItem') with timeout=10000
[00:08:30]                   │ info Taking screenshot "/dev/shm/workspace/parallel/19/kibana/x-pack/test/functional/screenshots/failure/Index Management app feature controls security global dashboard all with index_management_user should render the _Data_ section with index management.png"
[00:08:30]                   │ info Current URL is: http://localhost:61191/app/management
[00:08:30]                   │ info Saving page source to: /dev/shm/workspace/parallel/19/kibana/x-pack/test/functional/failure_debug/html/Index Management app feature controls security global dashboard all with index_management_user should render the _Data_ section with index management.html
[00:08:30]                   └- ✖ fail: Index Management app feature controls security global dashboard all with index_management_user should render the "Data" section with index management
[00:08:30]                   │      Error: expected [ { sectionId: 'ingest',
[00:08:30]                   │     sectionLinks: [ 'beats_management' ] },
[00:08:30]                   │   { sectionId: 'data',
[00:08:30]                   │     sectionLinks: [ 'index_management', 'transform' ] } ] to have a length of 1 but got 2
[00:08:30]                   │       at Assertion.assert (/dev/shm/workspace/parallel/19/kibana/packages/kbn-expect/expect.js:100:11)
[00:08:30]                   │       at Assertion.length (/dev/shm/workspace/parallel/19/kibana/packages/kbn-expect/expect.js:374:8)
[00:08:30]                   │       at Context.<anonymous> (test/functional/apps/index_management/feature_controls/index_management_security.ts:63:34)
[00:08:30]                   │       at runMicrotasks (<anonymous>)
[00:08:30]                   │       at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:08:30]                   │       at Object.apply (/dev/shm/workspace/parallel/19/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)
[00:08:30]                   │ 
[00:08:30]                   │ 

Stack Trace

Error: expected [ { sectionId: 'ingest',
    sectionLinks: [ 'beats_management' ] },
  { sectionId: 'data',
    sectionLinks: [ 'index_management', 'transform' ] } ] to have a length of 1 but got 2
    at Assertion.assert (/dev/shm/workspace/parallel/19/kibana/packages/kbn-expect/expect.js:100:11)
    at Assertion.length (/dev/shm/workspace/parallel/19/kibana/packages/kbn-expect/expect.js:374:8)
    at Context.<anonymous> (test/functional/apps/index_management/feature_controls/index_management_security.ts:63:34)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at Object.apply (/dev/shm/workspace/parallel/19/kibana/packages/kbn-test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [e4b1ea1]

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cnasikas cnasikas merged commit fa5933f into elastic:7.x Feb 8, 2021
@cnasikas cnasikas deleted the backport/7.x/pr-90605 branch February 8, 2021 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants